<template>
  <view class="reformList">
    <!-- 整改申请记录
    <view class="nav" :style="{ background: showBg ? '#333' : '' }">
      <global-nav-bar
        type="black"
        left-icon="back"
        color="'#333'"
        title="整改任务申请记录"
        :fixed="false"
        :isLeftBackShow="true"
        backgroundColor="#dbeaf7"
      ></global-nav-bar>
    </view> -->
    <view class="header"> 
      <view>{{ msg.buildingName }}</view>
      <view>{{msg.elevatorAddress}}</view>
    </view>
    <view class="listBox" v-if="msg.list.length">
      <block v-for="(item, index) in msg.list" :key="index">
        <repair-card v-if="item.typeStatus == 2" :msg="item"></repair-card>
        <affair-card v-else :msg="item"></affair-card>
      </block>
    </view>
    <view v-else>
      <empty></empty>
    </view>
  </view>
</template>

<script>
// import GlobalNavBar from "@/components/uni-nav-bar/global-nav-bar";
import repairCard from './components/reformCard.vue/repairCard.vue';
import affairCard from './components/reformCard.vue/affairCard.vue';
import {getReformList } from '@/apis/affair.js';
import empty from '../components/default/default.vue';
export default {
	components: {
		repairCard,
		affairCard,
		empty
	},
	onLoad(e) {
		// console.log(e)
		this.planId = e.planId;
		this.getReformList();
	},
	data() {
		return {
			planId:'',
			msg:{
				list:[],
				buildingName:'',
				elevatorAddress:''
			},
      
		};
	},
	methods:{
		getReformList() {
			getReformList({planId:this.planId})
				.then(res=>{
					console.log(res);
					if (res) {
						this.msg = res.data;
					}
				});
		}
	}
};
</script>
<style>
page {
  background: #f4f6f8;
}
</style>
<style lang="scss" scoped>
.nav {
  position: sticky;
  top: 0;
  z-index: 112;
}
.reformList {
  background: #fafafa;
  .header {
    background: #2c2c2c;
    color: #fff;
    padding: 40rpx 20rpx 36rpx 20rpx;
    .name{
      font-size: 36rpx;
      margin-bottom: 4rpx;
     }
    .address{
      font-size: 26rpx;
    }
  }
}
.listBox {
  margin: 20rpx;
  //   background: pink;
  padding-bottom: 120rpx;
}
</style>
